package org.novelhibernate.core;

import java.lang.reflect.Method;

/**
 * This is the internal class that wrap the variable need for JDBC when a
 * batch operation occurs this can improve the efficiency by saving the
 * general data (method instance) inside, so only the first one of data
 * would need to analysis the right method to call
 * 
 * 
 * The metadata for the data bind on target and the alias mapper data will be stored in here
 * 
 * @author Tao Chen
 * 
 */
public class ArgumentWrapper {
	
	
    // The target holder
	// this is only a carrier variable, will not be used after execute method
	private Object variable;
	
	private Method preparedStatementSetMethod;

	private int index;

	// The class of target holder
    private Class<?> targetClass;
	
	// used to get the actual data that needs to be put in PrepareStatement
	private Method[] methodArray;

	public ArgumentWrapper() {

	}

	public Object getVariable() {
		return variable;
	}

	public void setVariable(Object variable) {
		this.variable = variable;
	}


	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public Method getPreparedStatementSetMethod() {
		return preparedStatementSetMethod;
	}

	public void setPreparedStatementSetMethod(
			Method preparedStatementSetMethod) {
		this.preparedStatementSetMethod = preparedStatementSetMethod;
	}

	public Class<?> getTargetClass() {
		return targetClass;
	}

	public void setTargetClass(Class<?> targetClass) {
		this.targetClass = targetClass;
	}

	public void clean() {		
		variable = null;

	}

	public Method[] getMethodArray() {
		return methodArray;
	}

	public void setMethodArray(Method[] methodArray) {
		this.methodArray = methodArray;
	}
}